<script lang="ts" setup>
import { storeToRefs } from 'pinia'
import useStore from '../store'

const { channel } = useStore()
// #2 组件中调用 action
// 方法可以直接结构
const { getChannelList } = channel
getChannelList()

// #3 获取 channel 模块中 state 中的数据
const { channelList } = storeToRefs(channel)
</script>

<template>
  <ul class="catagtory">
    <li class="select" v-for="item in channelList" :key="item.id">{{ item.name }}</li>
  </ul>
</template>

<style scoed lang="less"></style>
